package com.atguigu.flink.day03;

import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

import java.util.Arrays;

/**
 * @author Felix
 * @date 2023/12/2
 * 该案例演示了源算子---从集合中读取数据
 */
public class Flink02_source_collect {
    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

        // DataStreamSource<Integer> colDS = env
        //     .fromCollection(Arrays.asList(1, 2, 3, 4));
        // colDS.print();

        DataStreamSource<Integer> eleDS = env.fromElements(1, 2, 3, 4);
        eleDS.print();

        env.execute();
    }
}
